package org.bx.idgenerator.manager;

import org.bx.idgenerator.bean.LoginUserBean;

/**
 * 当前应用下文持有器
 * @author
 * @version V1.0
 *  
 * @date: 2020年07月13日 18时24分
 * 
 * 
 */
public class CurrentContextHolder {
    private static final ThreadLocal<LoginUserBean> localContext = new ThreadLocal<>();

    public static LoginUserBean getUser(){
        return localContext.get();
    }

    public static void setUser(LoginUserBean loginUser){
        localContext.set(loginUser);
    }

    public static void clearContext(){
        localContext.remove();
    }
}
